home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !preview / RCS / c / main < prev    next >
Encoding:
Text File  |  1990-07-27  |  18.0 KB  |  680 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    gtoal:1.2;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     91.03.02.13.59.17;  author gtoal;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     91.03.02.13.55.51;  author gtoal;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @Initial release
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @IAY's upgrade
  28. @
  29. text
  30. @/* main.c --- main of Preview.  */
  31.  
  32. #include "d2rd.h"
  33. #include "menus.h"
  34. #include <stdarg.h>
  35. #include <stdio.h>
  36. #include <stdlib.h>
  37. #include <string.h>
  38. #include "output.h"
  39. #include "kernel.h"
  40. #include "template.h"
  41. #include "resspr.h"
  42. #include "res.h"
  43. #include "font.h"
  44. #include "bbc.h"
  45. #include "colourtran.h"
  46. #include "flex.h"
  47. #include "visdelay.h"
  48.  
  49. struct dvi_file *dvi_files = NULL;
  50. struct display *windows;
  51.  
  52. os_error *err;
  53. wimp_i iconbar_icon;
  54. wimp_w proginfo, saveas;
  55.  
  56.  
  57. /* The filetype of the file to be saved.  This is set according to the icon
  58.    type of the user_drag from the saveas window.  */
  59.  
  60. int saveas_filetype;
  61.  
  62.  
  63. /* The buffer where the input of the SAVEAS_FILENAME icon is put.  */
  64.  
  65. char *saveas_buffer;
  66.  
  67.  
  68. /* The MY_REF field as put in the message header by the wimp when sending the
  69.    DATASAVE message.  */
  70.  
  71. int msg_ref;
  72.  
  73.  
  74. /* To keep things extremely simple, all windows display a sprite which has
  75.    the same mode as the current screenmode.  Hence, on a mode-change every
  76.    sprite needs to be redefined.  And we always need to know the current mode.  */
  77.  
  78. int vdu_mode;
  79.  
  80. /* Record where the menu was opened, so it can be used to influence the
  81.    reopening of a window after choosing a new magnification.  */
  82.  
  83. wimp_mousestr menu_pos;
  84.  
  85. /* To have ourselves in the executable image.  */
  86.  
  87. char copyright_notice[] =
  88. "This is !Preview\nCopyright 1990 Graham Toal and Pieter Schoenmakers\n";
  89.  
  90.  
  91. /* This function is called at exit.  */
  92.  
  93. void
  94. cleanup (void)
  95. {
  96.   if (loading_a_file)
  97.     visdelay_end ();
  98.   wimp_taskclose (wimpt_task ());
  99. }
  100.  
  101.  
  102.  
  103. void
  104. set_saveas_state (char *file_name, char *sprite_name)
  105. {
  106.   wimp_icreate ic;
  107.   int i;
  108.  
  109.   /* Change the file icon.  */
  110.  
  111.   wimpt_noerr (wimp_get_icon_info (saveas, SAVEAS_FILEICON, &ic.i));
  112.   ic.i.flags = wimp_ISPRITE | wimp_IHCENTRE | wimp_IVCENTRE | wimp_INDIRECT | (6 << 12);
  113.   ic.i.data.indirectsprite.name = sprite_name;
  114.   ic.i.data.indirectsprite.spritearea = (void *) 1;
  115.   ic.i.data.indirectsprite.nameisname = TRUE;
  116.   ic.w = saveas;
  117.   wimpt_noerr (wimp_delete_icon (saveas, SAVEAS_FILEICON));
  118.   wimpt_noerr (wimp_create_icon (&ic, &i));
  119.   if (i != SAVEAS_FILEICON)
  120.     tfatal ("xfer_send template mangled");
  121.  
  122.   /* Change the file name.  */
  123.  
  124.   wimpt_noerr (wimp_get_icon_info (saveas, SAVEAS_FILENAME, &ic.i));
  125.   saveas_buffer = ic.i.data.indirecttext.buffer;
  126.   strcpy (saveas_buffer, file_name);
  127. }
  128.  
  129.  
  130.  
  131. void
  132. initialise (void)
  133. {
  134.   char fname[1024];   /* YECH! */
  135.   wimp_icreate ic;
  136.   wimp_i dum;
  137.  
  138.   wimpt_init (PROGRAM_NAME);
  139.   atexit (cleanup);
  140.  
  141.   res_init ("Preview");
  142.   resspr_init ();
  143.   res_findname ("Templates", fname);
  144.   template_init ();
  145.   template_readfile (fname);
  146.   visdelay_init ();
  147. #ifdef USE_FLEX
  148.   flex_init ();
  149. #endif
  150.  
  151.   vdu_mode = (_kernel_osbyte (135, 0, 0) >> 8) & 0xff;
  152.  
  153.   /* prefetch the aboutbox and saveas windows.  */
  154.  
  155.   wimpt_noerr (wimp_create_wind (template_syshandle ("progInfo"), &proginfo));
  156.   wimpt_noerr (wimp_create_wind (template_syshandle ("xfer_send"), &saveas));
  157.  
  158.   /* Record where the saveas window puts the filename.  */
  159.  
  160.   wimpt_noerr (wimp_get_icon_info (saveas, SAVEAS_FILENAME, &ic.i));
  161.   saveas_buffer = ic.i.data.indirecttext.buffer;
  162.  
  163.   /* Our IconBar icon. */
  164.  
  165.   ic.w = -1;
  166.   ic.i.box.x0 = 0;
  167.   ic.i.box.y0 = 0;
  168.   ic.i.box.x1 = 68;
  169.   ic.i.box.y1 = 68;
  170.   ic.i.flags = wimp_ISPRITE | wimp_INDIRECT | (3 << 12);
  171.   ic.i.data.indirectsprite.name = "!Preview";
  172.   ic.i.data.indirectsprite.spritearea = resspr_area ();
  173.   ic.i.data.indirectsprite.nameisname = 5;
  174.   wimpt_noerr (wimp_create_icon (&ic, &iconbar_icon));
  175.  
  176.   /* Put the VERSION_STRING information in the aboutbox.  */
  177.  
  178.   ic.w = proginfo;
  179.   ic.i.box.x0 = 154;
  180.   ic.i.box.y0 = -208;
  181.   ic.i.box.x1 = 630;
  182.   ic.i.box.y1 = -160;
  183.   ic.i.flags = wimp_ITEXT | wimp_INDIRECT | wimp_IBORDER | wimp_IFILLED | wimp_IHCENTRE | wimp_IVCENTRE | (7 << 24);
  184.   ic.i.data.indirecttext.buffer = version_string;
  185.   ic.i.data.indirecttext.validstring = "";
  186.   ic.i.data.indirecttext.bufflen = strlen (version_string) + 1;
  187.   wimpt_noerr (wimp_create_icon (&ic, &dum));
  188.  
  189.   iconbar_menu = menu_syshandle (menu_new (PROGRAM_NAME, ">Info,Quit"));
  190.   mag_menu = menu_new ("", "\\magstep0,\\magstephalf,\\magstep1,\\magstep2,\\magstep3,\\magstep4,\\magstep5,75dpi tweak");
  191.   saveas_menu = menu_new ("", ">Sprite,>Drawfile");
  192.   goto_page = menu_new ("", "42424242");
  193.   menu_make_writeable (goto_page, 1, goto_page_buffer, 12, "a0-9");
  194.   window_menu = menu_new (PROGRAM_NAME, "Next,Previous,Goto page,Magnification,New view|Save|Close,Quit");
  195.   menu_submenu (window_menu, 1 + MAINMENU_GOTO_PAGE, goto_page);
  196.   menu_submenu (window_menu, 1 + MAINMENU_MAGNIFICATION, mag_menu);
  197.   menu_submenu (window_menu, 1 + MAINMENU_SAVEAS, saveas_menu);
  198.  
  199.   x_os_scale = 1 << bbc_vduvar (bbc_XEigFactor);
  200.   y_os_scale = 1 << bbc_vduvar (bbc_YEigFactor);
  201. } /* initialise */
  202.  
  203.  
  204.  
  205. void
  206. redraw_window(struct display *w)
  207. {
  208.   int more;
  209.   double xs, ys;
  210.   int x, y;
  211.   wimp_redrawstr r;
  212.  
  213.   r.w = w->w_handle;
  214.   wimp_redraw_wind (&r, &more);
  215.  
  216.   factors (w, &xs, &ys);
  217.   font_converttoos( (int)(w->hor_offset * xs), 0, &x, &y );
  218.   while (more)
  219.     {
  220.       wimpt_noerr (sprite_put_given (w->area, &w->sid, 0,
  221.                                      r.box.x0 - r.scx + x,
  222.                                      r.box.y1 - r.scy + y));
  223.       wimp_get_rectangle (&r, &more);
  224.     }
  225. }
  226.  
  227.  
  228. void
  229. close_window (wimp_w wh)
  230. {
  231.   struct display *w;
  232.  
  233.   for (w = windows; w; w = w->next)
  234.     if (w->w_handle == wh)
  235.       break;
  236.  
  237.   if (w == NULL)
  238.     return;
  239.  
  240.   if (! w->file->complete)
  241.     {
  242.       fatal ("Cannot delete a file while still loading it (sorry).");
  243.       return;
  244.     }
  245.  
  246.   wimp_close_wind (wh);
  247.   wimp_delete_wind (wh);
  248.  
  249.   do_a_poll ();
  250.  
  251.   visdelay_begin ();
  252.   delete_display (wh);
  253.   visdelay_end ();
  254. }
  255.  
  256.  
  257. int
  258. main (int argc, char *argv[])
  259. {
  260.   int i;
  261.  
  262.   initialise ();
  263.  
  264.   for (i = 1; i < argc; i++)
  265.     read_a_file (argv[i]);
  266.  
  267.   for (;;)
  268.     do_a_poll ();
  269.  
  270.   exit (0);        /* Calls cleanup ().  */
  271.   return (0);      /* To keep stupid compiler happy.  */
  272. } /* main */
  273.  
  274.  
  275. /* Handle any pending events.  If LOADING_A_FILE is TRUE, return when the
  276.    NULL event is encountered, otherwise never return.  */
  277.  
  278. void
  279. do_a_poll (void)
  280. {
  281.   wimp_eventstr b;
  282.   wimp_msgstr msg;
  283.   wimp_mousestr mstr;
  284.   struct display *w;
  285.   int event;
  286.  
  287.   do
  288.     {
  289.       if (loading_a_file)
  290.         wimpt_noerr (wimp_poll (0, &b));
  291.       else
  292.         wimpt_noerr (wimp_pollidle (0, &b, 0));
  293.  
  294.       event = b.e;
  295.  
  296.       switch (event)
  297.         {
  298.         case wimp_EREDRAW:
  299.           for (w = windows; w; w = w->next)
  300.             if (w->w_handle == b.data.o.w)
  301.               break;
  302.           if (w)
  303.             redraw_window (w);
  304.  
  305.           break;
  306.  
  307.         case wimp_EOPEN:
  308.           wimp_open_wind (&b.data.o);
  309.           break;
  310.  
  311.         case wimp_ECLOSE:
  312.           close_window (b.data.o.w);
  313.           break;
  314.  
  315.         case wimp_EBUT:
  316.           handle_buttons (&b.data);
  317.           break;
  318.  
  319.         case wimp_EUSERDRAG:
  320.           {
  321.             char *s;
  322.             _kernel_swi_regs r;
  323.  
  324.             wimpt_noerr (wimp_get_point_info (&mstr));
  325.             msg.hdr.size = sizeof (wimp_msgstr);
  326.             msg.hdr.your_ref = 0;
  327.             msg.hdr.action = wimp_MDATASAVE;
  328.             msg.data.datasave.w = mstr.w;
  329.             msg.data.datasave.i = mstr.i;
  330.             msg.data.datasave.x = mstr.x;
  331.             msg.data.datasave.y = mstr.y;
  332.             msg.data.datasave.estsize = (saveas_filetype == 0xff9 ? 4 + flex_size ((flex_ptr) &which_menu->area)
  333.                                                                   : (54 * which_menu->page->text_max + 68 * which_menu->page->rule_max
  334.                                                                      + which_menu->page->char_max + 40));
  335.             msg.data.datasave.type = saveas_filetype;
  336.             s = strrchr (saveas_buffer, '.');
  337.             if (s == NULL)
  338.               s = saveas_buffer;
  339.  
  340.             if (strlen (s) > 11)
  341.               {
  342.                 fatal ("Bad filename");
  343.                 break;
  344.               }
  345.             strcpy (&msg.data.datasave.leaf[0], s);
  346.  
  347.             r.r[0] = wimp_ESENDWANTACK;
  348.             r.r[1] = (int) &msg;
  349.             r.r[2] = mstr.w;
  350.             r.r[3] = mstr.i;
  351.             _kernel_swi (0x400e7, &r, &r);
  352.  
  353.             msg_ref = msg.hdr.my_ref;
  354. #if 0       /* Do not delete the menu yet!  */
  355.             wimp_create_menu ((wimp_menustr *) -1, 0, 0);
  356. #endif
  357.           }
  358.  
  359.           break;
  360.  
  361.         case wimp_EMENU:
  362.           if (which_menu == NULL)
  363.             {
  364.               /* Something was selected from the iconbar menu.  */
  365.  
  366.               switch (b.data.menu[0])
  367.                 {
  368.                 case ICONBARMENU_QUIT:
  369.                   exit (0);
  370.                 default:
  371.                   break;
  372.                 }
  373.             }
  374.           else
  375.             {
  376.               wimp_redrawstr r;
  377.  
  378.               w = which_menu;
  379.               switch (b.data.menu[0])
  380.                 {
  381.                 case MAINMENU_NEXT:
  382.                   do_a_poll ();
  383.  
  384.                   w->page = w->page->next;
  385.                   if (w->page == NULL)
  386.                     w->page = w->file->pages;
  387.  
  388.                   set_window_title (w);
  389.                   fill_sprite (w);
  390.  
  391.                   r.w = w->w_handle;
  392.                   r.box.x0 = 0;
  393.                   r.box.y0 = 0;
  394.                   r.box.x1 = 1000000000;
  395.                   r.box.y1 = 1000000000;
  396.                   wimp_force_redraw (&r);
  397.  
  398.                   break;
  399.  
  400.                 case MAINMENU_PREVIOUS:
  401.                   {
  402.                     struct page *p = w->file->pages;
  403.  
  404.                     do_a_poll ();
  405.  
  406.                     while (p->next && p->next != w->page)
  407.                       p = p->next;
  408.                     w->page = p;
  409.  
  410.                     set_window_title (w);
  411.                     fill_sprite (w);
  412.  
  413.                     r.w = w->w_handle;
  414.                     r.box.x0 = 0;
  415.                     r.box.y0 = 0;
  416.                     r.box.x1 = 1000000000;
  417.                     r.box.y1 = 1000000000;
  418.                     wimp_force_redraw (&r);
  419.                   }
  420.  
  421.                   break;
  422.  
  423.                 case MAINMENU_GOTO_PAGE:
  424.                   {
  425.                     int i;
  426.                     struct page *p;
  427.  
  428.                     if (b.data.menu[1] == -1)
  429.                       break;
  430.  
  431.                     i = atoi (goto_page_buffer);
  432.                     if (i == 0)
  433.                       break;
  434.  
  435.                     for (p = w->file->pages; p; p = p->next)
  436.                       if (p->dvi_page == i)
  437.                         break;
  438.  
  439.                     if (p == NULL || p->complete == FALSE)
  440.                       {
  441.                         if (loading_a_file && current_dvi_file == w->file)
  442.                           fatal ("Page does not exist or has not been loaded yet.");
  443.                         else
  444.                           fatal ("Page does not exist.");
  445.                         break;
  446.                       }
  447.                     if (p == w->page)
  448.                       {
  449.                         fatal ("Page is already being displayed.");
  450.                         break;
  451.                       }
  452.  
  453.                     w->page = p;
  454.                     set_window_title (w);
  455.  
  456.                     fill_sprite (w);
  457.  
  458.                     r.w = w->w_handle;
  459.                     r.box.x0 = 0;
  460.                     r.box.y0 = 0;
  461.                     r.box.x1 = 1000000000;
  462.                     r.box.y1 = 1000000000;
  463.                     wimp_force_redraw (&r);
  464.  
  465.                     break;
  466.                   }
  467.                 case MAINMENU_MAGNIFICATION:
  468.                   {
  469.                     wimp_winfo wi;
  470.  
  471.                     if (b.data.menu[1] == -1 || b.data.menu[1] == w->magstep)
  472.                       break;
  473.  
  474.                     wi.w = w->w_handle;
  475.                     wimp_get_wind_info (&wi);
  476.  
  477.                     do_a_poll ();
  478.  
  479.                     if (b.data.menu[1] == 7 /* 75dpi tweak */) {
  480.                        if (w->mag_tweak == 1.0) w->mag_tweak = 75.0/90.0;
  481.                                            else w->mag_tweak = 1.0;
  482.                     } else /* magstep selection */ {
  483.                        w->magstep = b.data.menu[1];
  484.                     }
  485.  
  486. #ifdef USE_FLEX
  487.                     flex_free ((flex_ptr) &w->area);
  488. #else
  489.                     free (w->area);
  490.                     w->area = 0;
  491. #endif
  492.                     define_sprite (w);
  493.                     fill_sprite (w);
  494.                     adjust_window_size (w);
  495.  
  496.                     break;
  497.                   }
  498.  
  499.                 case MAINMENU_CLONE:
  500.                   build_a_window (which_menu->file, which_menu->page);
  501.                   break;
  502.  
  503.                 case MAINMENU_CLOSE:
  504.                   close_window (w->w_handle);
  505.                   break;
  506.  
  507.                 case MAINMENU_QUIT:
  508.                   exit (0);
  509.                   break;
  510.  
  511.                 default:
  512.                   break;
  513.                 }
  514.             }
  515.           break;
  516.  
  517.         case wimp_ESCROLL:
  518.           if (ABS (b.data.scroll.x) == 2)
  519.             b.data.scroll.o.x += SGN (b.data.scroll.x) * (b.data.scroll.o.box.x1 - b.data.scroll.o.box.x0);
  520.           else if (ABS (b.data.scroll.x) == 1)
  521.             b.data.scroll.o.x += SGN (b.data.scroll.x) * 32;
  522.  
  523.           if (ABS (b.data.scroll.y) == 2)
  524.             b.data.scroll.o.y += SGN (b.data.scroll.y) * (b.data.scroll.o.box.y1 - b.data.scroll.o.box.y0);
  525.           else if (ABS (b.data.scroll.y) == 1)
  526.             b.data.scroll.o.y += SGN (b.data.scroll.y) * 32;
  527.  
  528.           wimp_open_wind (&b.data.scroll.o);
  529.           break;
  530.  
  531.         case wimp_ESEND:
  532.         case wimp_ESENDWANTACK:
  533.           switch (b.data.msg.hdr.action)
  534.             {
  535.             case wimp_MCLOSEDOWN:
  536.               exit (0);
  537.               break;
  538.  
  539.             case wimp_MDATASAVEOK:
  540.               if (b.data.msg.hdr.your_ref == msg_ref)
  541.                 {
  542.                   output_saveas (b.data.msg.data.datasaveok.name);
  543.                   wimp_create_menu ((wimp_menustr *) -1, 0, 0);
  544.  
  545.                   msg.hdr.size = sizeof (wimp_msgstr);
  546.                   msg.hdr.your_ref = 0;
  547.                   msg.hdr.action = wimp_MDATALOAD;
  548.                   msg.data.dataload.w = mstr.w;
  549.                   msg.data.dataload.i = mstr.i;
  550.                   msg.data.dataload.x = mstr.x;
  551.                   msg.data.dataload.y = mstr.y;
  552.                   msg.data.dataload.size = 0;
  553.                   msg.data.dataload.type = saveas_filetype;
  554.                   strcpy (msg.data.dataload.name, b.data.msg.data.datasaveok.name);
  555.                   wimpt_noerr (wimp_sendmessage (wimp_ESENDWANTACK, &msg, (wimp_t) mstr.w));
  556.                 }
  557.               break;
  558.  
  559.             case wimp_MMENUWARN:
  560.               if (which_menu == 0)
  561.                 {
  562.                   if (b.data.msg.data.words[3] == 0)
  563.                     wimpt_complain (wimp_create_submenu ((wimp_menustr *) proginfo, b.data.msg.data.words[1], b.data.msg.data.words[2]));
  564.                 }
  565.               else if (b.data.msg.data.words[3] == MAINMENU_SAVEAS)
  566.                 {
  567.                   if (b.data.msg.data.words[4] == SAVEASMENU_PAINT)
  568.                     {
  569.                       saveas_filetype = 0xff9;
  570.                       set_saveas_state ("Sprite", "file_ff9");
  571.                     }
  572.                   else
  573.                     {
  574.                       saveas_filetype = 0xaff;
  575.                       set_saveas_state ("DrawFile", "file_aff");
  576.                     }
  577.                   wimpt_complain (wimp_create_submenu ((wimp_menustr *) saveas, b.data.msg.data.words[1], b.data.msg.data.words[2]));
  578.                 }
  579.                 
  580.               break;
  581.  
  582.             case wimp_MMODECHANGE:
  583.               {
  584.                 int i = (_kernel_osbyte (135, 0, 0) >> 8) & 0xff;
  585.                 struct display *w;
  586.  
  587.                 if (vdu_mode == i)
  588.                   break;
  589.  
  590.                 vdu_mode = i;
  591.  
  592.                 for (w = windows; w; w = w->next)
  593.                   {
  594. #ifdef USE_FLEX
  595.                     flex_free ((flex_ptr) &w->area);
  596. #else
  597.                     free (w->area);
  598.                     w->area = 0;
  599. #endif
  600.                     define_sprite (w);
  601.                     fill_sprite (w);
  602.                     adjust_window_size (w);
  603.                   }
  604.               }
  605.               break;
  606.  
  607.             case wimp_MDATALOAD:
  608.               if (b.data.msg.data.dataload.w == -2 && b.data.msg.data.dataload.i == iconbar_icon)
  609.                 {
  610.                   read_a_file (b.data.msg.data.dataload.name);
  611.  
  612.                   b.data.msg.hdr.your_ref = b.data.msg.hdr.my_ref;
  613.                   b.data.msg.hdr.action = wimp_MDATALOADOK;
  614.                   wimp_sendmessage (wimp_ESEND, &b.data.msg, b.data.msg.hdr.task);
  615.                 }
  616.               break;
  617.  
  618.             case wimp_MDATAOPEN:
  619.               if (b.data.msg.data.dataopen.type == FILE_TYPE_DVI)
  620.                 {
  621.                   b.data.msg.hdr.your_ref = b.data.msg.hdr.my_ref;
  622.                   wimp_sendmessage (wimp_EACK, &b.data.msg, b.data.msg.hdr.task);
  623.                   read_a_file (b.data.msg.data.dataopen.name);
  624.                 }
  625.               break;
  626.  
  627.             case wimp_MRAMFETCH:
  628.               wimp_create_menu ((wimp_menustr *) -1, 0, 0);
  629.               output_send (&b.data.msg);
  630.               break;
  631.  
  632.             default:
  633.               break;
  634.             }
  635.           break;
  636.  
  637.         case wimp_EACK:
  638. #if 0
  639.           fatal ("/usr/msg/ack");
  640. #endif
  641.           break;
  642.  
  643.         default:
  644.           break;
  645.         }
  646.     }
  647.   while (event);
  648. } /* do_a_poll */
  649. @
  650.  
  651.  
  652. 1.1
  653. log
  654. @Initial revision
  655. @
  656. text
  657. @a106 1
  658.   wimp_icon iff;
  659. d161 1
  660. a161 1
  661.   mag_menu = menu_new ("", "\\magstep0,\\magstephalf,\\magstep1,\\magstep2,\\magstep3,\\magstep4,\\magstep5");
  662. d179 3
  663. a181 1
  664.   int more, x, y;
  665. d187 2
  666. a188 2
  667.   factors (w, &x, &y);
  668.  
  669. d192 2
  670. a193 2
  671.                                      r.box.x0 - r.scx + (int) ((double) w->hor_offset * (double) x / MAGNIFICATION_DIVISOR),
  672.                                      r.box.y1 - r.scy + (int) ((double) w->ver_offset * (double) y / MAGNIFICATION_DIVISOR)));
  673. a440 2
  674.                     wimp_openstr wo;
  675.                     int i = tex_magstep[w->magstep];
  676. d450 7
  677. a456 1
  678.                     w->magstep = b.data.menu[1];
  679. @
  680.